/* 
 * Project: colobok
 * and open the template in the editor.
 * @author: Sviatoslav Mysachenko <svyatoslavik@gmail.com>
 */

/**
 * return MapsEventListener
 * http://code.google.com/intl/ru-RU/apis/maps/documentation/javascript/reference.html#MapsEventListener - 
 */
google.maps.Map.prototype.bindEvent = function(eventName, listener){   
    return google.maps.event.addListener(this, eventName, listener);
    
}
google.maps.Map.prototype.bindOneEvent = function(eventName, listener){   
    return google.maps.event.addListenerOnce(this, eventName, listener);    
}

google.maps.Marker.prototype.bindOneEvent = function(eventName, listener){   
    return google.maps.event.addListenerOnce(this, eventName, listener);    
}

google.maps.Marker.prototype.bindEvent = function(eventName, listener){    
    return google.maps.event.addListener(this, eventName, listener);
}


google.maps.Map.prototype.unbindEvent = function(eventListener){
    if(typeof eventListener == 'object')
        google.maps.event.removeListener(eventListener);
    else if(typeof eventListener == 'string')
        google.maps.event.clearListeners(this, eventListener);
}
google.maps.Marker.prototype.unbindEvent = function(eventListener){
    if(typeof eventListener == 'object')
        google.maps.event.removeListener(eventListener);
    else if(typeof eventListener == 'string')
        google.maps.event.clearListeners(this, eventListener);
}